Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add validation for text alignment field in FieldContent struct #162

Merged
merged 3 commits into from
Oct 5, 2024

Conversation

njausteve
Copy link
Owner

Title

Add optional text_alignment field to FieldContent struct with validation

Type of Change

  • New feature

Description

This PR adds a new optional text_alignment field to the FieldContent struct, allowing the text in a field to be aligned to the left, center, right, or natural alignment. The supported values are "PKTextAlignmentLeft", "PKTextAlignmentCenter", "PKTextAlignmentRight", and "PKTextAlignmentNatural". Validation has been implemented to ensure that only these values are accepted. Tests have been updated to verify correct functionality.

Testing

New tests have been added to ensure that the text_alignment field accepts valid values and rejects invalid ones. Behavior when the field is omitted or set to nil has also been tested to ensure correct default handling.

Impact

This change is backward-compatible since the text_alignment field is optional. It enhances the flexibility of text presentation within the FieldContent struct.

Additional Information

N/A

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.

@njausteve
Copy link
Owner Author

njausteve commented Oct 5, 2024

closes: #155

@njausteve njausteve merged commit ad2beca into main Oct 5, 2024
5 checks passed
@njausteve njausteve deleted the 155-add-text-alignment-to-contentPassField branch October 5, 2024 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant